package com.asj.vivo.lock.service.oppoSdk.operation.base;

// 操作对类，封装操作和补偿操作
public class OperationPair {
    private final Operation operation;
    private final Compensation compensation;

    public OperationPair(Operation operation, Compensation compensation) {
        this.operation = operation;
        this.compensation = compensation;
    }

    public void execute() throws Exception {
        operation.execute();
    }

    public void undo() throws Exception {
        compensation.undo();
    }
}